package com.mit.web.util
{
	

	public class FileUtil
	{
		public static const WRAPPED_FILE_TYPE:String = "dat";
		public function FileUtil()
		{
		}
		
		/**
		 * 获取随机文件名, e.g 10289458001.dat
		 * 通常可用于重命名用户上传的文件
		 * */
		public static function get RandomFileName():String{
			var _time:String = Number(new Date()).toString();
			var _seed:String = Math.round(Math.random() * 100).toString();
			if(_seed.length == 1)
				_seed = "00" + _seed;
			else if (_seed.length == 2)
				_seed = "0" + _seed;
			
			return _time.concat(_seed).concat(".").concat(WRAPPED_FILE_TYPE);
			
		}
	}
}